//
//  ByPayStyleView.m
//  caipiao_ios
//
//  Created by mc on 2018/7/18.
//  Copyright © 2018年 ZhangZhanbin. All rights reserved.
//

#import "ByPayStyleView.h"

@implementation ByPayStyleView

- (id)init{
    self = [super init];
    if (self) {
        UIImageView *typeView = [[UIImageView alloc] init];
        [self addSubview:typeView];
        [typeView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(15);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(27, 27));
        }];
        typeView.image = [UIImage imageNamed:@"weixin"];
        
        UILabel *titleLabel = [[UILabel alloc] init];
        [self addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(typeView.mas_right).offset(10);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(250, 20));
        }];
        
        titleLabel.font = FONT(13);
        titleLabel.textColor = [UIColor blackColor];
        titleLabel.text = @"微信支付";
        
        UIButton *selectBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:selectBtn];
        [selectBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(-15);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(25, 25));
        }];
        [selectBtn setImage:[UIImage imageNamed:@"morendizhiweixuanzhong"] forState:UIControlStateNormal];
        [selectBtn setImage:[UIImage imageNamed:@"morendizhixuanzhong"] forState:UIControlStateSelected];
        
        UILabel *line = [[UILabel alloc] init];
        [self addSubview:line];
        [line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(0);
            make.right.equalTo(self).offset(0);
            make.bottom.equalTo(self).offset(0);
            make.height.mas_equalTo(@1);
        }];
        line.backgroundColor = BY_LINE_COLOR;
        
        self.titleLabel = titleLabel;
        self.typeView = typeView;
        self.selectBtn = selectBtn;
    }
    return self;
}

@end
